package com.itheima.reggie.common;

/*
工具类 ，获取线程中的值
 */
public class BaseContext {
    private BaseContext context;

    private static final ThreadLocal<Long>  THREAD_LOCAL_USERID =new ThreadLocal<>();
    //获取值
    public static Long getCurrentId(){
        return THREAD_LOCAL_USERID.get();
    }
    //设置值
    public static void setCurrentId(Long id){
        THREAD_LOCAL_USERID.set(id);
    }
    //销毁值
    public static void removeCurrentId(){
        THREAD_LOCAL_USERID.remove();
    }
}
